precision mediump float;
varying vec3 v_lightPos;
varying vec3 v_pos;
varying vec4 v_color;
varying vec3 v_norm;

void main() {
	vec3 diff = v_lightPos - v_pos;
	float dist = length(diff);
    vec3 lightVec = normalize(diff);
    float diffuse = max(dot(v_norm, lightVec), 0.) * (1.0 / (1.0 + (0.25 * dist * dist))) + .15;

    gl_FragColor = v_color * diffuse;
}
